<script id="content" type="text/template">
	
	
	<!--if{response.module_get}-->  
	<div class="panel panel-default">
		<div class="panel-body">
          	<div>模块ID：<!--{response.module_get.module_id}--></div>
			<div>模块名称：<!--{response.module_get.module_name}--></div>
			<div>更新时间：<!--{WangAho().date("yyyy/MM/dd HH:mm EEE", parseInt(response.module_get.module_update_time) * 1000)}--></div>
			<div>操作：
			<a href="#/administrator/module_edit/?id=<!--{response.module_get.module_id}-->" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-edit"></span>编辑</a>
			</div>
		</div>
	</div>
    <!--/if-->
	
	
	
	<!--if{response.module_get}-->
	<a href="#/administrator/authority_add/?module_id=<!--{response.module_get.module_id}-->" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> 添加</a>
	<!--else-->
	<a href="#/administrator/authority_add" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> 添加</a>
  	<!--/if-->
	<button class="btn btn-default" type="button" action-button="sort"><span class="glyphicon glyphicon-sort"></span> 排序</button>
	<button class="btn btn-danger" type="button" action-button="remove"><span class="glyphicon glyphicon-trash"></span> 删除</button>
	<button class="btn btn-default search" type="button" ><span class="glyphicon glyphicon-filter"></span> 筛选</button>
	<!--if{http().anchor.query.search}--><span class="label label-default">存在筛选</span><!--/if-->
	
	
	<hr/>
	<table class="table table-striped">
      <thead>
        <tr>
          <th><input type="checkbox" action-table="checkbox-all"></th>	
          <th>#</th>
          <th>
          	<!--if{http().anchor.query.sort == "id_desc"}-->
          	<a href="javascript:;" action-sort="id_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>权限ID</a>
          	<!--elseif{http().anchor.query.sort == "id_asc"}-->
          	<a href="javascript:;" action-sort="id_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>权限ID</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="id_desc">权限ID</a>
          	<!--/if-->
          </th>
          <th>
          	<!--if{http().anchor.query.sort == "name_desc"}-->
          	<a href="javascript:;" action-sort="name_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>权限名称</a>
          	<!--elseif{http().anchor.query.sort == "name_asc"}-->
          	<a href="javascript:;" action-sort="name_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>权限名称</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="name_desc">权限名称</a>
          	<!--/if-->
          </th>
          <th>权限描述</th>
          <th>
          	<!--if{http().anchor.query.sort == "sort_desc"}-->
          	<a href="javascript:;" action-sort="sort_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>排序</a>
          	<!--elseif{http().anchor.query.sort == "sort_asc"}-->
          	<a href="javascript:;" action-sort="sort_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>排序</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="sort_desc">排序</a>
          	<!--/if-->
          </th>
          <th>
          	<!--if{http().anchor.query.sort == "update_time_desc"}-->
          	<a href="javascript:;" action-sort="update_time_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>更新时间</a>
          	<!--elseif{http().anchor.query.sort == "update_time_asc"}-->
          	<a href="javascript:;" action-sort="update_time_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>更新时间</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="update_time_desc">更新时间</a>
          	<!--/if-->
          </th>
          
          <!--if{response.module_get}-->
          <!--else-->
          <th>
          	<!--if{http().anchor.query.sort == "module_id_desc"}-->
          	<a href="javascript:;" action-sort="module_id_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>模块信息</a>
          	<!--elseif{http().anchor.query.sort == "module_id_asc"}-->
          	<a href="javascript:;" action-sort="module_id_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>模块信息</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="module_id_desc">模块信息</a>
          	<!--/if-->
          </th>
          <!--/if-->
          <th>操作</th>
        </tr>
      </thead>
      <tbody>
      	<!--if{response.list.data.length}-->
      	<!--for{var i in response.list.data}-->
      	<tr>
          <th><input type="checkbox" action-table="checkbox" data-id="<!--{response.list.data[i].authority_id}-->"></th>
          <td><!--{parseInt(i)+1+((parseInt(response.list.page_now) - 1) * response.list.page_size)}--></td>
          <td><!--{response.list.data[i].authority_id}--></td>
          <td><!--{response.list.data[i].authority_name}--></td>
          <td>
          	<div id="tips-<!--{response.list.data[i].authority_info}-->" class="tips" data-title="查看权限简介" style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;width: 150px;cursor: pointer;" data="<!--{response.list.data[i].authority_info}-->"><!--{response.list.data[i].authority_info}--></div>
          </td>
          <td><input style="width: 80px;" type="text" class="form-control" placeholder="排序" action-table="sort" data-id="<!--{response.list.data[i].authority_id}-->" value="<!--{response.list.data[i].authority_sort}-->"></td>
          <td><!--{WangAho().date("yyyy/MM/dd HH:mm EEE", parseInt(response.list.data[i].authority_update_time) * 1000)}--></td>
          
          <!--if{response.module_get}-->
          <!--else-->
          <td>
          <!--if{response.list.data[i].module_insert_time}-->
          <!--{response.list.data[i].module_name}-->
          <!--else-->
          <span style="color: #999;">未设置</span>
          <!--/if-->
          </td>
          <!--/if-->
          
          <td>
          	<a href="#/administrator/authority_edit/?id=<!--{response.list.data[i].authority_id}-->" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-edit"></span>编辑</a>
          	<!--if{!response.module_get && response.list.data[i].module_id}-->
          	<a href="#/administrator/authority_list/?search=%257B%2522module_id%2522%253A%2522<!--{response.list.data[i].module_id}-->%2522%257D" class="btn btn-default btn-sm">
	          	<span class="glyphicon glyphicon-filter"></span> 只查看该模块
	        </a>
	        <!--/if-->
          </td>
        </tr>
        <!--/for-->
      	<!--else-->
        <tr>
          <td colspan="10" align="center">无数据</td>
        </tr>
        <!--/if-->
      </tbody>
    </table>
    
    
    
    <!--if{response.list.data.length}-->
	<div class="paging" style="text-align: center;">
		<button class="first btn btn-default <!--if helper{"is_first_page" (response.list.page_now)}-->disabled<!--/if-->" data-page="1" type="button">首页</button>
		<button class="previous btn btn-default <!--if helper{"is_first_page" (response.list.page_now)}-->disabled<!--/if-->" data-page="<!--{parseInt(response.list.page_now) - 1}-->" type="button">上一页</button>
		<button class="btn btn-default" type="button">
			第<!--{response.list.page_now}-->页
			/ 共<!--{response.list.page_count}-->页
			/ 有<!--{response.list.row_count}-->条数据</button>
		<button class="next btn btn-default <!--if helper{"is_end_page" (response.list.page_now, response.list.page_count)}-->disabled<!--/if-->" type="button" data-page="<!--{parseInt(response.list.page_now) + 1}-->">下一页</button>
		<button class="end btn btn-default <!--if helper{"is_end_page" (response.list.page_now, response.list.page_count)}-->disabled<!--/if-->" type="button" data-page="<!--{response.list.page_count}-->">尾页</button>
	</div>
	<div class="form-inline" style="text-align: center;margin-top: 10px;">
		<div class="form-group">
			<input type="text" class="form-control paging--value" placeholder="输入跳转页" style="width: 100px;">
		</div>
		<button type="button" class="btn btn-default paging--submit">跳转</button>
	</div>
	<!--/if-->
	
</script>





<script id="search" type="text/template">
	<div style="padding: 10px;width: 500px;">
		<div class="form-group">
		    <label>权限ID：</label>
		    <input type="text" class="form-control" search placeholder="输入要搜索的权限ID" name="authority_id" value="<!--{search.authority_id}-->">
		</div>
		<div class="form-group">
		    <label>权限名称：</label>
		    <input type="text" class="form-control" placeholder="输入要搜索的权限名称" name="authority_name" value="<!--{search.authority_name}-->">
		</div>
		<div class="form-group">
		    <label>模块：</label>
		    <select class="form-control" name="module_id">
			  <option value="">-请选择要筛选的模块-</option>
			  <!--if{module_option.length}-->
			  <!--for{var i in module_option}-->
			  <option value="<!--{module_option[i].module_id}-->" <!--if{search.module_id == module_option[i].module_id}-->selected="selected"<!--/if--> >
			  <!--{module_option[i].module_name}-->
			  </option>
			  <!--/for-->
			  <!--/if-->
			</select>
		</div>
		
		<br/>
		<div class="btn-group" style="width: 100%;">
			<button type="button" class="btn btn-primary" style="width: 50%;" name="search-submit">确定筛选</button>
			<button type="button" class="btn btn-default" style="width: 50%;" name="search-clear">清理筛选</button>
		</div>
	</div>
</script>


